/*	
 *	Created By: Matthew Hoyes
 *	Date: May 03, 2010
 *
 =========================================================
						- Card.cpp -

 * Class: Card Class

 * What this class is for:

	- Create an indivual card represented by:
			- a card value (2,3,4,5,6,7,8,9,10,J,Q,K,A)
			- a suit type (clubs, hearts, spades, diamonds)

 =========================================================
 */

#include "Card.h"

// C01: Default Constructor
Card::Card()									
{
	// implement code here
	suit = CardSuit::Blank_Suit;
	cardValue = CardValue::Blank_Value;
}

// C02: Overloaded Constructor
Card::Card(CardSuit theSuit, CardValue theValue)
{
	// implement code here
	suit = theSuit;
	cardValue = theValue;
}


Card::~Card() { /*do nothing for now*/ }


Card::Card(Card const &c)
{
	suit = c.getSuit();
	cardValue = c.getValue();
}


Card const &Card::operator =(Card const &c)
{
	if (this == &c) { return *this; }
	else
	{
		suit = c.getSuit();
		cardValue = c.getValue();
		return *this;
	}
}

// M01: Sets the suit of the card
void Card::setCardSuit(CardSuit const &theSuit)		
{
	suit = theSuit;
}

// M02: Sets the value of the card
void Card::setCardValue(CardValue const &theValue)		
{
	cardValue = theValue;
}

// M03: Returns the suit of the card
CardSuit Card::getSuit() const						
{
	return suit;
}

// M04: Returns the value of the card
CardValue Card::getValue() const						
{
	return cardValue;
}

void Card::DisplayCard()
{
	//cout << "The ";
	Convert_CV_2String(cardValue);

	cout << " - ";
	
	Convert_Suit2String(suit);

	cout << endl << endl;
}

/*
void Card::discard(Card theCard, Card otherCard)
{
	otherCard = theCard;
}
*/

//Don't need this method, should be using the assignment operator...
void Card::discard(Card const &card)
{
	suit = card.getSuit();
	cardValue = card.getValue();
}

void Card::suitHeader(int index)
{
	if(index == 0)
	{
		cout << "=============================\n";
		cout << "\tSet of Spades\n";
		cout << "=============================\n";
	}
	if(index == 13)
	{
		cout << "=============================\n";
		cout << "\tSet of Clubs\n";
		cout << "=============================\n";
	}
	if(index == 26)
	{
		cout << "=============================\n";
		cout << "\tSet of Hearts\n";
		cout << "=============================\n";
	}
	if(index == 39)
	{
		cout << "=============================\n";
		cout << "\tSet of Diamonds\n";
		cout << "=============================\n";
	}
}